"""ProjLifecycleMgt URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include
from rest_framework import routers

from django.conf import settings
from django.conf.urls.static import static

from ProjLifecycleMgt import views

router = routers.DefaultRouter()
router.register(r'users', views.UserVS)
router.register(r'system/groups', views.TempGroupVS)
router.register(r'system/templates', views.TemplateVS)
router.register(r'field/types', views.FieldTypeVS)
router.register(r'template/fields', views.TempFieldVS)
router.register(r'project/flows', views.ProFlowVS)
router.register(r'flow/tasks', views.FlowTaskVS)
router.register(r'instances', views.InstanceVS)
router.register(r'flow/insts', views.FlowInstVS)
router.register(r'task/subtasks', views.SubTaskVS)
router.register(r'task/attachs', views.SubTaskAttachVS)
router.register(r'project/events', views.ProEventVS)
router.register(r'event/attachs', views.EventAttachVS)

urlpatterns = [
    path('', include(router.urls)),
    path('admin/', admin.site.urls),
    path('login/',views.LoginVW.as_view()),
    path('project/infos/', views.ProjectInfo.as_view()),
    path('inst/search/',views.InstSearch.as_view()),
    path('event/search/',views.ProEventSearch.as_view()),
    path('inst/upload/',views.InstUpload.as_view()),
    path('inst/upload/<int:id>/',views.InstUpload.as_view())
] + static(settings.MEDIA_URL, document_root = settings.MEDIA_ROOT)
